import java.io.*;

public class T3 {

    /**
     *  按行读取文件内容并将每行中的数字打印出来
     * @param args
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        String filePath = "test.txt";
        BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(filePath)));
        String line = null;
        while((line = reader.readLine())!=null){
            char[] lineChar = line.toCharArray();
            int len = lineChar.length;
            int i=0;
            StringBuffer sbf = new StringBuffer();
            while (i<len){
                char ch = lineChar[i];
                if(ch>='0' && ch<='9'){
                    sbf.append(ch);
                }
                i++;
            }
            System.out.println(sbf.toString());
        }
        reader.close();
    }

}
